package LEKIEUANH.OPP.EX06;

public class MODELS {

	public String CheckIsEvenOdd(int ivalue, int opt){
		String StrOut = "";
		int i = 0;
		while(i<= ivalue){
			if(opt == 0){
				if(i%2 == 0){
					if(StrOut.isEmpty()){
						StrOut += i;
					}else{
						StrOut = " - " + i;
					}
				}
			}else{
				//TH là lẻ
				if(opt == 1){
					if(i%2!=0){
						if(StrOut.isEmpty()){
							StrOut += i;
						}else{
							StrOut = " - " + i;
						}
					}
				}
				i = i++;
			}
		}
		return StrOut;
		
	}
}
